package com.offline.module.user.canal;

import com.offline.module.user.entity.user.UserInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import top.javatool.canal.client.annotation.CanalTable;
import top.javatool.canal.client.handler.EntryHandler;

/**
 * @author ZhangHaiWen
 * @title: UserInfoHandler
 * @projectName offline-discount-sys
 * @description: TODO
 * @date 2022/3/2120:37
 */
@Slf4j
@Component
@CanalTable(value = "user-module")
public class UserInfoHandler implements EntryHandler<UserInfo> {

    /**
     * 插入时
     * @param goodsInfo
     */
    @Override
    public void insert(UserInfo goodsInfo) {
        log.info(goodsInfo.toString());
    }

    /**
     * 更新时候
     * @param before 更新前的数据
     * @param after 更新后的数据
     */
    @Override
    public void update(UserInfo before, UserInfo after) {
        log.info(after.toString());
    }

    /**
     *  删除时的数据
     * @param goodsInfo
     */
    @Override
    public void delete(UserInfo goodsInfo) {
        log.info(goodsInfo.toString());
    }

}
